{% extends 'front/base_front.html' %}

{% block css %}
    {{ super() }}
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/userinfo.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/index_2.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/front/my_orders.css') }}">

{% endblock %}

{% block title %}我{% endblock %}

{% block main %}
    <div class="container-fluid">
        <hr>
        <div class="row clearfix col-md-12">
            <div class="col-md-2">
                <div class="info-list col-md-10 col-md-offset-1">
                    <ul class="list-unstyled ">
                        <li {% if active_nav == 'me' %}class="active"{% endif %}>
                            <a href="{{ url_for('userinfo.userinfo') }}"> 我 </a>
                        </li>
                        <li {% if active_nav == 'order' %}class="active"{% endif %}>
                            <a href="{{ url_for('orders.get_orders') }}">我的订单</a>
                        </li>
                        <li {% if active_nav == 'info' %}class="active"{% endif %}>
                            <a href="{{ url_for('userinfo.info') }}">我的信息</a>
                        </li>
                        <li {% if active_nav == 'address' %}class="active"{% endif %}>
                            <a href="{{ url_for('userinfo.address') }}">收货人信息</a>
                        </li>
                        <li {% if active_nav == 'collection' %}class="active"{% endif %}>
                            <a href="{{ url_for('userinfo.collection') }}">我的收藏</a>
                        </li>
                        <li {% if active_nav == 'history' %}class="active"{% endif %}>
                            <a href="{{ url_for('userinfo.get_history') }}">浏览历史</a>
                        </li>
                    </ul>
                </div>
                <div class="col-md-10 col-md-offset-1 recommend text-center" ng-controller="recommend_user">
                    <div class="text-center"><p>推荐</p></div>
                    <ul>
                        <li ng-repeat="book in recommend_book">
                            <a href="/product%3F{{ '{{book.id}}' }}" class="text-center">
                                <img src="{{ '{{book.img}}' }}" title="{{ '{{book.title}}' }}"
                                     alt="{{ '{{book.title}}' }}">
                                <p>{{ '{{book.title}}' }}</p>
                                <p>{{ '{{book.author}}' }}</p>
                            </a>
                            <hr>
                        </li>
                    </ul>
                </div>
            </div>
            {% block main_right %}
                <div class="col-md-10 column right">
                    <div class="userinf_content">
                        {% block info_content %}
                            <div class="user-avatar left">
                                {% if user.avatar %}
                                    <img src="{{ url_for('static', filename='images/avatar/'+user.avatar) }}"
                                         class="userinfo-img" alt="头像" title="头像">
                                {% else %}
                                    <img src='' class="userinfo-img" alt="头像" title="头像">
                                {% endif %}
                            </div>
                            <div class="username left">
                                <h3>{% if user.name %}
                                    用户名：{{ user.name }}
                                {% else %}
                                    <a href="{{ url_for('userinfo.info') }}">去添加资料</a>
                                {% endif %}
                                </h3>
                            </div>
                        {% endblock %}
                    </div>
                </div>
            {% endblock %}
        </div>
    </div>
    <hr>
{% endblock %}

{% block js %}
    {{ super() }}
    <script type=text/javascript>$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};</script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/jquery-3.5.1.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/userinfo_in_head.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/userinfo.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/angular.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/fronts/get_book_type.js') }}"></script>
{% endblock %}